package adfc2.render3d;

import java.lang.reflect.Field;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Константы цветов
 */
public class Colors {

    private Colors() {
    }

    public static final double[] WHITE = {1, 1, 1, 1};
    public static final double[] GRAY75 = {0.75, 0.75, 0.75, 1};
    public static final double[] GRAY50 = {0.5, 0.5, 0.5, 1};
    public static final double[] GRAY25 = {0.25, 0.25, 0.25, 1};
    public static final double[] BLACK = {0, 0, 0, 1};

    public static final double[] DARK_RED = {0.5, 0, 0, 1};
    public static final double[] DARK_GREEN = {0, 0.5, 0, 1};
    public static final double[] DARK_BLUE = {0, 0, 0.5, 1};

    public static final double[] RED = {1, 0, 0, 1};
    public static final double[] GREEN = {0, 1, 0, 1};
    public static final double[] BLUE = {0, 0, 1, 1};

    public static final double[] YELLOW = {1, 1, 0, 1};
    public static final double[] MAGENTA = {1, 0, 1, 1};
    public static final double[] AQUA = {0, 1, 1, 1};

    public static final double[] ORANGE = {1, 0.5, 0, 1};

    public static final Map<String, double[]> COLOR_CONSTANTS;

    static {
        Map<String, double[]> cc = new HashMap<String, double[]>();
        for (Field field : Colors.class.getDeclaredFields()) {
            try {
                if (field.getType().isArray() && field.getType().getComponentType() == Double.TYPE) {
                    cc.put(field.getName(), (double[]) field.get(null));
                }
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
        COLOR_CONSTANTS = Collections.unmodifiableMap(cc);
    }
}
